﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BinaryTree
{
    public class VAmountOfNodesOnILevel:IVisit
    {
        private int amount = 0;
        public static int i,j;
        public int Amount { get { return amount; } }
        public void Visit(treeNode _root)
        {
            if (i > 0)
            {
                if (_root == null)
                {
                    amount += 0;
                }
                else
                {
                    if (i == 1)
                    {
                        amount += 1;
                    }
                    else
                    {
                        i = i - 1;
                    //    Visit(_root.left);
                    //    Visit(_root.right);
                    }
                }
            }
        }
    }
}
